﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HYWJ
{
    public partial class ConnectionNet : Form
    {
        public ConnectionNet()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ConnectionNet_Load(object sender, EventArgs e)
        {

            this.Hide();
            //调用ConnectNet类
            this.notifyIcon1.ShowBalloonTip(5, "网络连接状态提示", "网络连接状态：正常", ToolTipIcon.Info);
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            HY_Model.ConnectNet CNet = new HY_Model.ConnectNet();
            if (CNet.IsConnected())
            {


                notifyIcon1.Text = "网络连接状态：正常";
            }
            else
            {
                notifyIcon1.Icon = SystemIcons.Error;
                notifyIcon1.Text = "网络连接状态：断开";
            }
        }

        private void ConnectionNet_FormClosed(object sender, FormClosedEventArgs e)
        {
            notifyIcon1.Dispose();
            Application.Exit();

        }
    }
}
